<?php

use App\Http\Controllers\ExpertController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\VideoController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/login',[UserController::class,'login'])->name('login');
Route::post('/login',[UserController::class,'dologin']);
Route::get('/logout',[UserController::class,'logout'])->middleware('auth');

Route::get('/adm',[UserController::class,'admin'])->middleware('auth');
Route::prefix('/adm')->middleware('auth')->group(function(){
    Route::get('/expertlist',[ExpertController::class,'expertlist']);
    Route::get('/userlist',[UserController::class,'userlist']);
    Route::get('/video/video-list',[VideoController::class,'videolist']);
    Route::get('/user/add-user',[UserController::class,'create']);
    Route::post('/user/add-user',[UserController::class,'store']);
    Route::get('/expert/add-expert',[ExpertController::class,'create']);
    Route::post('/expert/upload-expert-thumb',[ExpertController::class,'upload']);
    Route::post('/expert/add-expert',[ExpertController::class,'store']);
    Route::get('/video/add-video',[VideoController::class,'create']);
    Route::post('/video/add-video',[VideoController::class,'store']);
    Route::post('/video/upload-video-thumb',[VideoController::class,'upload']);
    Route::get('/user/edit-user/{id}',[UserController::class,'edit']);
    Route::post('/user/edit-user/{id}',[UserController::class,'update']);
    Route::get('/expert/edit-expert/{id}',[ExpertController::class,'edit']);
    Route::post('/expert/edit-expert/{id}',[ExpertController::class,'update']);
    Route::get('/video/edit-video/{id}',[VideoController::class,'edit']);
    Route::post('/video/edit-video/{id}',[VideoController::class,'update']);
    Route::get('/video/edit-video/{id}',[VideoController::class,'edit']);
    Route::post('/video/edit-video/{id}',[VideoController::class,'update']);
    Route::get('/user/delete-user/{id}',[UserController::class,'delete']);
    Route::get('/expert/delete-expert/{id}',[ExpertController::class,'delete']);
    Route::get('/video/delete-video/{id}',[VideoController::class,'delete']);
});
Route::get('/expert',[ExpertController::class,'expert']);
Route::get('/conf',[VideoController::class,'conf']);
Route::get('/review',[VideoController::class,'review']);
Route::get('/review/review-info/{id}',[VideoController::class,'reviewInfo']);
Route::get('/expert/expert-info/{id}',[ExpertController::class,'expertInfo']);
Route::get('/',[VideoController::class,'index']);
